import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/home',
            component: () => import('@/views/index/HomeIndex.vue')
        },
        {
            path: '/',
            redirect: "/home"
        },
        {
            path: '/document',
            component: () => import('@/views/index/DocumentIndex.vue'),
            children: [
                {
                    path: '/document/list',
                    component: () => import('@/views/document/DocumentList.vue')
                },
                {
                    path: '/document/add',
                    component: () => import('@/views/document/AddDocument.vue')
                },
                {
                    path: '/document/show',
                    component: () => import('@/views/document/ShowDocument.vue')
                },
                {
                    path: '/document/edit',
                    component: () => import('@/views/document/EditDocument.vue')
                },
            ]
        },
        {
            path: '/author',
            component: () => import('@/views/index/AuthorIndex.vue'),
            children: [
                {
                    path: '/author/list',
                    component: () => import('@/views/author/AuthorList.vue')
                },
            ]
        },
        {
            path: '/quotation',
            component: () => import('@/views/index/QuotationIndex.vue'),
            children: [
                {
                    path: '/quotation/add',
                    component: () => import('@/views/quotation/AddQuotation.vue')
                },
                {
                    path: '/quotation/list',
                    component: () => import('@/views/quotation/QuotationList.vue')
                },
                {
                    path: '/quotation/edit',
                    component: () => import('@/views/quotation/EditQuotation.vue')
                },
            ]
        },
        {
            path: '/statistic',
            component: () => import('@/views/index/StatisticIndex.vue'),
        }
    ]
})

export default router
